src: add event loop based metrics into node#62935
Open
pabloerhard wants to merge 2 commits intonodejs:mainfrom
Open
src: add event loop based metrics into node#62935pabloerhard wants to merge 2 commits intonodejs:mainfrom
pabloerhard wants to merge 2 commits intonodejs:mainfrom
Conversation
rochdev
reviewed
Apr 24, 2026
addaleax
reviewed
Apr 24, 2026
| } | ||
|
|
||
| uv_close(reinterpret_cast<uv_handle_t*>(&prepare_handle_), | ||
| PrepareCloseCB); |
Member
There was a problem hiding this comment.
This should call the superclass's method instead of duplicating it
Author
There was a problem hiding this comment.
Calling HandleWrap::Close() would just uv_close check_handle_ immediately, run HandleWrap::OnClose and treat the wrap as fully torn down.
This would leave prepare_handle_ on need of a uv_close, so you’d risk a libuv handle leak or teardown in the wrong order relative to HandleWrap’s lifecycle.
edb66ea to
e7093c8
Compare
add a samplePerIteration option to monitorEventLoopDelay that records event loop delay from libuv event loop iterations instead of the existing timer interval sampler. The default remains the interval based, uses of monitorEventLoopDelay() will still behave the same unless the samplePerIteration options is passed through. Signed-off-by: Pablo Erhard Hernandez <[email protected]>
Add test coverage for the per iteration event loop delay histogram start and stop callbacks Use disitinct debug tracking keys for the event loop delay histogram callbacks.
6f5cdca to
bc0a59c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an opt in into monitorEventLoopDelay(), this option adds support for per iteration sampling using libuv hooks, while preserving the existing timer based approach.
When the new samplePerIteration option is set to true, monitorEventLoopDelay() samples directly from event loop iterations instead of using the interval timer. When samplePerIteration is omitted or false, the existing interval based implementation remains unchanged, including resolution handling and the older interval based trace counters.
Motivation
The interval based implementation has two limitations that the new option addresses:
This is an alternative implementation to the one in #62934